nonetype is not iterable python